

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	self.Pos = data:GetOrigin()
	self.DieTime = CurTime() + math.random(10,14)
	self.Emitter = ParticleEmitter( self.Entity.Pos )
	self.Freq = 9
	self.Wind = WindVector or Vector(math.random(-10,10),math.random(-10,10),0)

end


/*---------------------------------------------------------
   THINK
   Returning false makes the entity die
---------------------------------------------------------*/
function EFFECT:Think( )
	if self.Freq == 9 then
		self.Freq = 0
		local particle = self.Emitter:Add("particles/smokey", self.Pos + (VectorRand()*math.random(-5,5)))

		particle:SetVelocity(Vector(math.Rand(-3,3),math.Rand(-3,3),math.Rand(40,50)) + self.Wind)
		particle:SetDieTime( math.Rand(10,13) )
		particle:SetStartAlpha( math.random( 5, 25 ) )
		particle:SetEndAlpha( 0 )
		particle:SetStartSize( math.Rand( 80, 90 ) )
		particle:SetEndSize( math.Rand( 280, 350 ) )
		particle:SetRoll( math.Rand( -180, 180 ) )
		particle:SetRollDelta( math.Rand( -0.1, 0.1 ) )
		
		local randy = math.random(5,40)
		particle:SetColor( randy,randy,randy ) //lols
	else
		self.Freq = self.Freq + 1
	end
		
	if self.DieTime > CurTime() then
		return true
	else
		self.Emitter:Finish()
		return false
	end
end


/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()
	// Do nothing - this effect is only used to spawn the particles in Init
end
